unicode-truncate
Unicode-aware algorithm to pad or truncate str
in terms of displayed width.
Examples
Safely truncate string to display width even not at character boundaries.
use UnicodeTruncateStr;
Making sure the string is displayed in exactly number of columns by combining padding and truncating.
use UnicodeTruncateStr;
use Alignment;
use UnicodeWidthStr;
Features
unicode-truncate
can be built without std
by disabling the default feature std
. However, in
that case unicode_truncate::UnicodeTruncateStr::unicode_pad
won't be available because it depends
on std::string::String
and std::borrow::Cow
.